package web_model

import (
	"time"

	"gorm.io/gorm"
)

const TableNameSysDept = "sys_dept"

// SysDept mapped from table <sys_dept>
type SysDept struct {
	ID         int64          `gorm:"column:id;type:integer;primaryKey" json:"id"`
	TenantID   int64          `gorm:"column:tenant_id;type:integer" json:"tenant_id"`
	ParentID   int64          `gorm:"column:parent_id;type:integer" json:"parent_id"`
	ParentName string         `gorm:"column:parent_name;type:text(128)" json:"parent_name"`
	Leaders    string         `gorm:"column:leaders;type:text(256)" json:"leaders"`
	Name       string         `gorm:"column:name;type:text(128)" json:"name"`
	Sort       int64          `gorm:"column:sort;type:integer" json:"sort"`
	CreatedBy  string         `gorm:"column:created_by;type:text(20)" json:"created_by"`
	UpdatedBy  string         `gorm:"column:updated_by;type:text(20)" json:"updated_by"`
	CreatedAt  time.Time      `gorm:"column:created_at;type:DATETIME" json:"created_at"`
	UpdatedAt  time.Time      `gorm:"column:updated_at;type:DATETIME" json:"updated_at"`
	DeletedAt  gorm.DeletedAt `gorm:"column:deleted_at;type:DATETIME" json:"deleted_at"`
}

// TableName SysDept's table name
func (*SysDept) TableName() string {
	return TableNameSysDept
}
